package cn.harry.modular.sms.service.impl;

import cn.harry.modular.sms.param.SmsParam;
import cn.harry.modular.sms.service.SmsStrategy;
import cn.harry.modular.sms.vo.SmsTemplateDto;
import com.alibaba.fastjson.JSON;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
 * ClassName: FakeSmsStrategy Description: 伪造发送短信信息
 *
 * @author honghh Date 2019/08/30 14:13 Copyright (C) www.tech-harry.cn
 */
@Slf4j
@Component
@ConditionalOnProperty(value = "aliyun.sms.enabled", havingValue = "false")
public class FakeSmsStrategy implements SmsStrategy {

	@Override
	public SendSmsResponse send(SmsParam smsParam, SmsTemplateDto smsTemplate) {
		return JSON.parseObject(
				"{\"bizId\":\"111111111\",\"code\":\"OK\",\"message\":\"并未真实发送\",\"requestId\":\"111111111\"}",
				SendSmsResponse.class);
	}

}
